package com.yaoli.meituan;

import java.util.Arrays;
import java.util.Scanner;

/**
 * Created by will on 2017/6/13.
 */
public class Test02 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int len1 = in.nextInt();
        int array [] = new int[len1];
        for(int i = 0 ; i < len1 ; i++){
            array[i] = in.nextInt();
        }
        //int array[] = {1,2,3,4, 4,4,4,5};
        //小mei
        int mei = array[0];

        int res = 0;
        Arrays.sort(array);


        int begin = 0;
        int end = array.length - 1;

        while(begin < end){
            int middle = (end + begin) / 2;

            if(mei > array[middle]){
                begin = middle + 1;
            }else if(mei < array[middle]){
                end = middle - 1;
            }else{
                begin = middle + 1;
            }

            res++;
        }

        System.out.println(res);


    }
}
